package com.eorchis.module.predeptassignedinfo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.eorchis.core.basedao.dao.IDaoSupport;
import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.core.service.impl.AbstractBaseService;

import com.eorchis.module.predeptassignedinfo.dao.IPreDeptAssignedInfoDao;
import com.eorchis.module.predeptassignedinfo.domain.PreDeptAssignedInfo;
import com.eorchis.module.predeptassignedinfo.domain.PreDeptAssignedInfoBean;
import com.eorchis.module.predeptassignedinfo.service.IPreDeptAssignedInfoService;
import com.eorchis.module.predeptassignedinfo.ui.commond.PreDeptAssignedInfoQueryCommond;
import com.eorchis.module.predeptassignedinfo.ui.commond.PreDeptAssignedInfoValidCommond;

/**
 * Title: PreDeptAssignedInfoServiceImpl<br>
 * Description: 单位年度分配参学预授权名额表管理业务接口实现<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author Administrator
 * @createDate 2015-01-25
 * @version $Revision$
 */
// 声明本类为Server实现类，声明bean名称
@Service(value = "com.eorchis.module.predeptassignedinfo.service.impl.PreDeptAssignedInfoServiceImpl")
public class PreDeptAssignedInfoServiceImpl extends AbstractBaseService implements IPreDeptAssignedInfoService {

	@Resource(name = "com.eorchis.module.predeptassignedinfo.dao.impl.PreDeptAssignedInfoDaoImpl")
	private IPreDeptAssignedInfoDao preDeptAssignedInfoDao;
	
	@Override
	public IDaoSupport getDaoSupport() {
		return preDeptAssignedInfoDao;
	}

	@Override
	@SuppressWarnings("unchecked")
	public PreDeptAssignedInfoValidCommond toCommond(IBaseEntity entity) {
		return new PreDeptAssignedInfoValidCommond((PreDeptAssignedInfo)entity);
	}
	/**
	 * 查询预分配参学名额列表
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author NingSS
	 * @date 2015-1-25
	 */
	@Override
	public List<PreDeptAssignedInfoBean> findPreDeptAssignedInfoList(
			PreDeptAssignedInfoQueryCommond queryCommond) throws Exception {
		return preDeptAssignedInfoDao.findPreDeptAssignedInfoList(queryCommond);
	}
	/**
	 * 修改预分配参学名额列表上的限定人数
	 * @param validCommond
	 * @return
	 * @throws Exception
	 * @author NingSS
	 * @createDate 2015-1-25
	 */
	@Override
	public boolean updatePreDeptAssignedInfo(PreDeptAssignedInfoValidCommond validCommond) throws Exception {
		return preDeptAssignedInfoDao.updatePreDeptAssignedInfo(validCommond);
	}
	/**
	 * 预分配参学名额:未选单位列表
	 * @param queryCommond
	 * @return
	 * @throws Exception
	 * @author NingSS
	 * @date 2015-1-25
	 */
	@Override
	public List<PreDeptAssignedInfoBean> findNoSelectSignupDeptList(
			PreDeptAssignedInfoQueryCommond queryCommond) throws Exception {
		return preDeptAssignedInfoDao.findNoSelectSignupDeptList(queryCommond);
	}
	/**
	 * 删除预分配参学名额
	 * @param validCommond
	 * @return
	 * @throws Exception
	 * @author NingSS
	 * @createDate 2015-1-25
	 */
	@Override
	public boolean deletePreDeptAssignedInfo(PreDeptAssignedInfoQueryCommond queryCommond)
			throws Exception {
		boolean result=false;
		try{
			preDeptAssignedInfoDao.delete(PreDeptAssignedInfo.class, queryCommond.getSearchIds());
			result=true;
		}catch(Exception e){
			e.printStackTrace();
		}
		return result;
	}
	
	
}
